{extend name="public/header" /}

{block name="title"}{//$purviewTreeArr[$currentPurviewId]['purview_name']}{/block}
{block name="js"}
<script type="text/javascript" src="/admin/js/xadmin.js"></script>
{/block}
{block name="body"}
<body>
<div class="layui-fluid">
    <div class="layui-row">
        <form class="layui-form">
            <div class="layui-form-item">
                <label for="password" class="layui-form-label">
                    <span class="x-red">*</span>新密码
                </label>
                <div class="layui-input-inline">
                    <input type="password" id="password" name="password" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="password" class="layui-form-label">
                    <span class="x-red">*</span>确认密码
                </label>
                <div class="layui-input-inline">
                    <input type="password" id="re_password" name="re_password" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"> </label>
                <button class="layui-btn" lay-filter="submit" lay-submit="" type="button">
                    提交
                </button>
            </div>
        </form>
    </div>
</div>
<script>
    layui.use(['form', 'layer'], function () {
        var form = layui.form,
            layer = layui.layer;

        //监听提交
        form.on('submit(submit)', function (obj) {
            $.ajax({
                type: "post",
                url: obj.form.action,
                data: obj.field,
                dataType: "json",
                success: function (res) {
                    if (res.code != 0) {
                        layer.msg(res.msg, {
                            icon: 2,
                            time: 2000//2秒关闭（如果不配置，默认是3秒）
                        });
                    } else {
                        layer.msg(res.msg, {
                            icon: 1,
                            time: 1000 //2秒关闭（如果不配置，默认是3秒）
                        }, function () {
                            parent.location.reload()
                        });
                    }
                }
            });
            return false;
        });
    });
</script>
{/block}
</body>
